﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ctlPaymentsPlan.ascx.cs" Inherits="Ctl_ctlPaymentsPlan" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate >
    <table style="width: 100%;" cellpadding ="2px" cellspacing "0">
    <tr>
        <td width="20px" class="grd_td_item">
            &nbsp;</td>
        <td class="grd_td_item">            
            Дата</td>
        <td class="grd_td_item">            
            Сумма</td>
        <td class="grd_td_item" width="20px">
            &nbsp;</td>
    </tr>
<asp:ListView ID="lvList" runat="server" onitemcommand="lvList_ItemCommand" 
            onitemediting="lvList_ItemEditing" onitemupdating="lvList_ItemUpdating">
<LayoutTemplate>
                       <tr runat="server" id="itemPlaceholder" >
                       </tr>                            
</LayoutTemplate>
<ItemTemplate >
    <tr>
        <td class="grd_td_item" width="20px">
            <asp:ImageButton ID="btnRemove" CommandArgument =<%# Eval("ID").ToString() %> runat="server" OnClick ="btnRemoveClick" 
                ImageUrl="~/images/icon-delete.gif" />
        </td>
        <td class="grd_td_item">
            <%# ( Convert .ToDateTime (Eval("Date")) ).ToShortDateString () %>            
            </td>
        <td class="grd_td_item">            
            <%# Eval("Summa")%> </td>
        <td colspan="2" style ="text-align :right" class ="grd_td_item">
            <asp:ImageButton ID="ImageButton2" runat="server"  CommandName ="Edit"
                ImageUrl="~/images/icon-edit.gif" />
        </td>
    </tr>
</ItemTemplate>
<EditItemTemplate >
<tr>
        <td class="grd_td_item" width="20px">
            <asp:ImageButton ID="btnRemove" CommandArgument =<%# Eval("ID").ToString() %> runat="server" OnClick ="btnRemoveClick" 
                ImageUrl="~/images/icon-delete.gif" />
         <asp:HiddenField ID="hfCurrentRow" Value =<%# Eval("ID") %> runat="server" />
        </td>
        <td class="grd_td_item">
            <asp:TextBox ID="txtDate" Text =<%# ( Convert .ToDateTime (Eval("Date")) ).ToShortDateString () %> CssClass ="TextBox"   runat="server"></asp:TextBox>            
            <cc1:CalendarExtender Format="dd.MM.yyyy" ID="txtDateExt" runat="server" Enabled="True" TargetControlID="txtDate">
            </cc1:CalendarExtender>

            </td>
        <td class="grd_td_item">          
            <asp:TextBox ID="txtSumma" Width ="200px" Text =<%# Eval("Summa")%> CssClass ="TextBox" runat="server"></asp:TextBox>
            <cc1:MaskedEditExtender ID="me_txtOTS"
                    Mask="99999999"
                    runat="server"
                    MessageValidatorTip="true" 
                    OnFocusCssClass="MaskedEditFocus" 
                    OnInvalidCssClass="MaskedEditError"                                        
                    InputDirection="LeftToRight"    
                    AcceptNegative="Left"                     
                    ErrorTooltipEnabled="True"                     
                    TargetControlID="txtSumma"
                    ClearTextOnInvalid ="false" 
                     >     
              </cc1:MaskedEditExtender> 
             </td>
        <td colspan="2" style ="text-align :right" class ="grd_td_item">            
            <asp:ImageButton ID="btnUpdate" CommandName ="Update" runat="server" ImageUrl="~/images/icon-save.gif" />
            
        </td>
    </tr>
</EditItemTemplate>

</asp:ListView>    
    <tr>
        <td width="20px">
            &nbsp;</td>
        <td>
            &nbsp;
        </td>
        <td colspan="2" style ="text-align :right ">
            <asp:Button ID="btnAdd" CssClass ="btn" runat="server" Text="Добавить" 
                onclick="btnAdd_Click" />
        </td>
    </tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>



